﻿
using Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Admin
{
    public partial class Mainform : Form
    {
        int ori_x,ori_y;

        public Mainform()
        {
            InitializeComponent();
        }

        private void Form1_Shown(object sender, EventArgs e)
        {
            login();
        }

        //private void button1_Click(object sender, EventArgs e)
        //{
        //    login();
        //}

        private void login()
        {
            this.Visible = false; ;
            Login frm_login = new Login();
            if (frm_login.ShowDialog() == DialogResult.OK)
            {
                this.Visible = true;
                label1.Text = "欢迎：" + log_info.admin.admin_uname;
            }
            else
                this.Close();
        }

        //private void button4_Click(object sender, EventArgs e)
        //{
        //    Assign assign_form = new Assign();
        //    assign_form.ShowDialog();
        //}

        //private void button5_Click(object sender, EventArgs e)
        //{
        //    Manual_adjust manul_Adjust = new Manual_adjust();
        //    manul_Adjust.ShowDialog();
        //}

        //private void button6_Click(object sender, EventArgs e)
        //{
        //    config frm_config = new config();
        //    frm_config.ShowDialog();
        //}

        private void button7_Click(object sender, EventArgs e)
        {
            entitiy_form ef = new entitiy_form();
            ef.ShowDialog();
        }

        //private void button8_Click(object sender, EventArgs e)
        //{
        //    TeacherData teacherData = new TeacherData();
        //    teacherData.ShowDialog();
        //}

        //private void button9_Click(object sender, EventArgs e)
        //{
        //    StudentData studentData = new StudentData();
        //    studentData.ShowDialog();
        //}

        private void uilayout3_Click(object sender, EventArgs e)
        {
            login();
        }

        private void uiauto4_Click(object sender, EventArgs e)
        {
            Assign assign_form = new Assign();
            assign_form.ShowDialog();
        }

        private void uimanual5_Click(object sender, EventArgs e)
        {
            Manual_adjust manul_Adjust = new Manual_adjust();
            manul_Adjust.ShowDialog();
        }

        private void uiButtonset6_Click(object sender, EventArgs e)
        {
            config frm_config = new config();
            frm_config.ShowDialog();
        }

        private void uiButton1_Click(object sender, EventArgs e)
        {
            StudentData studentData = new StudentData();
            studentData.ShowDialog();
        }

        private void uiBut_teadata_Click(object sender, EventArgs e)
        {
            TeacherData teacherData = new TeacherData();
            teacherData.ShowDialog();
        }

        private void pictureBox2_Click(object sender, EventArgs e)
        {
            login();
        }
    }
}
